<?php
/**
 * Builder.php
 *
 * This is where the mainMenu and footerMenu are built.
 * @package PHPZendOpcacheBundle
 * @author Steven King <kingrst@gmail.com>
 * @copyright Copyright (C) 2014, Steven King
 * @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3
 */

  namespace PHP\ZendOpcacheBundle\Menu;

  use Knp\Menu\FactoryInterface;
  use Symfony\Component\DependencyInjection\ContainerAware;

  use Nelmio\ApiDocBundle\Annotation\ApiDoc;

/**
 * Builder Class for PHPZendOpcacheBundle
 *
 * The Builder class creates the mainMenu and footerMenu objects.
 * @package PHPZendOpcacheBundle\Menu
 * @subpackage Builder
 * @category class
 * @author Steven King <kingrst@gmail.com>
 */
class Builder extends ContainerAware {
  public function mainMenu(FactoryInterface $factory, array $options) {
    $menu = $factory->createItem('root');

    $menu->addChild('Home', array('route' => 'php_zend_opcache_homepage'));
    $menu->addChild('List Scripts', array('route' => 'php_zend_opcache_list_scripts'));
    $menu->addChild('Reset Cache', array('route' => 'php_zend_opcache_reset_cache'));
    $menu->addChild('Raw Output', array('route' => 'php_zend_opcache_raw_stats'));

    return $menu;
  }

  public function footerMenu(FactoryInterface $factory, array $options) {
    $menu = $factory->createItem('root');

    $menu->addChild('PHP.net', array('uri' => 'http://php.net'));
    $menu->addChild('PHP: OPcache - Manual', array('uri' => 'http://php.net/opcache'));
    $menu->addChild('Credits', array('route' => 'php_zend_opcache_credits'));

    return $menu;
  }
}
?>
